<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" session="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
    <meta name="renderer" content="webkit">
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
    <META HTTP-EQUIV="Expires" CONTENT="0">
    <title>我的零钱</title>
    
    <link href="${pageContext.request.contextPath}/static/css/common.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/plugins/bootstrap-3.3.5/css/bootstrap.min.css"
          rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/plugins/font-awesome-4.3.0/css/font-awesome.min.css"
          rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/plugins/select2-4.0.0/dist/css/select2.min.css"
          rel="stylesheet">
    <!-- jqgrid-->
    <link href="${pageContext.request.contextPath}/static/plugins/jqGrid/css/custom.ui.jqgrid.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/plugins/layer/skin/layer.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/plugins/jqGrid/css/style.css" rel="stylesheet">

    <script src="${pageContext.request.contextPath}/static/js/jquery-1.11.3.min.js"></script>
    <script src="${pageContext.request.contextPath}/static/js/jquery.form.js"></script>
    <script src="${pageContext.request.contextPath}/static/js/common.js"></script>
    <script src="${pageContext.request.contextPath}/static/plugins/bootstrap-3.3.5/js/bootstrap.min.js"></script>
    <script src="${pageContext.request.contextPath}/static/plugins/jqGrid/js/i18n/grid.locale-cn.js"></script>
    <script src="${pageContext.request.contextPath}/static/plugins/jqGrid/js/minified/jquery.jqGrid.min.js"></script>
    <script src="${pageContext.request.contextPath}/static/plugins/layer/layer.js" type="text/javascript"></script>
	<script src="${pageContext.request.contextPath}/static/js/global.js"></script>
	<script src="${pageContext.request.contextPath}/static/plugins/select2-4.0.0/dist/js/select2.min.js"></script>
	<script type="text/javascript"
            src="${pageContext.request.contextPath}/static/plugins/My97DatePicker/WdatePicker.js"></script>
    <style type="text/css">
      .main h5 a {
            position: absolute;
            right: 20px;
            font-size: 14px;
            bottom: 0px;
            display: inline-block;
            padding: 5px;
        }
		
        .table_list tbody tr {
            height: 35px;
            text-align: center;
        }
        .div1{
           margin-top: 16px;
    		border: solid #CCCCCC;
    		border-width: 1px 0px 0px 0px;
        }
        .td3{
        	border:solid #CCCCCC; 
        	border-width:0px 1px 1px 0px; 
        	padding:10px 0px; width: 30%;
        	height: 120px;
        	}
        .enjoyA{
			color: orangered;
			font-size: 25px;
			margin-left: 26px;
        }
        .enjoyA:hover{
			color: orangered;
			}
        .enjoyB{
			color: #CCCCCC;
			font-size: 18px;
			margin-left: 26px;
        }
        .name1{
        	font-size: 20px;
        	margin-left: 12px;
			*+margin-left: 8px;
			margin-bottom:6px;
        }
		.left ul li
			*line-height:40px
			*padding-left:20px;
		}
		
		.left ul li a, .left ul li a:hover{
			*color:#fff;
		}
		.list-tab li{
			*+padding:0px 10px 10px;
		}
		
		.btn{
			padding:2px 4px;
			font-size:12px !important;
			margin: 0 2px;
			*width:65px;
			*+padding:2px 0;
			*+padding-left:0;
			*+font-size:12px;
		}
		.name1 .btnn{
			*width:102px;
			*+width:120px;
		}
		.lt{
			float:left;
		}
		.ui-pg-button{
			*background:#ccc;
		}
		.col-md-3{
			*width:100px;
		}
		.form-group{
			*overflow: hidden;
		}
		.pagination{
			*margin-left:50%;
		}
		.wrapper{
			*margin-left:270px;
		}
		#rName{
			*padding:0;
		}
		#enjoyTable .wallet{
			font-size:20px;
			color:#111;
			margin-bottom:0;
		}
		.wallet span{
			color:red;
			font-size:14px;
		}
		.wallet span span{
			font-size:26px;
		}
		.child{
			margin-right:10px;
			font-size:14px;
		}
		.name1 span{
		   margin-right:8px;
		   margin-right:4px\0;
		}
		.name1 span span{
		  margin-left:2px;
		}
		.name1 .spa{
			font-size:22px;
			color:red;
			margin-right:70px;
			*+float:left;
			*+margin-right:90px;
		}
		
		@-moz-document url-prefix(){.name1 .spa{margin-right:70px;}}
		.date{
			width:120px !important;
			*height:30px;
		}
		.input-group-addon{
			height:34px;
			line-height:20px;
			width:60px;
			height:34px\9;
			width:60px\9;
			*height:18px;
		}
		.selectlabe1{
			width:110px !important;
			*+width:80px !important;
		}
		.form-control{
			*+padding:0;
		}
		.form-action1{
			margin-left:0px;
			*+margin-left:0px;
		}
		#query,#resetForm{
			width:50px\0;
			height:30px;
			line-height:28px;
			height:24px\0;
			line-height:24px\0;
			*+line-height:22px;
			padding:0;
		}
		.col-md-1{
			width:7%\0;
		}
		.col-sm-3{
			width:36%;
		}
		.col-md-3{
			width:36%;
		}
		.no_padding{
			padding-right:0;
		}
		.jg-grid{
			*+margin-left:270px;
		}
		.jg-grid a{
			color:#666;
			padding:0 14px;font-size: 14px;
		}
		.jg-grid .act{
			color:#6fa4d6;
		}
		.form-group {
			margin-bottom: 0px;
		}
    </style>
</head>
<body view="menu-item-4142">
<jsp:include page="../../top.jsp"></jsp:include>
<div class="right">
 	<div class="wrapper">
        <div class="panel panel-default">
        
        	<table id="enjoyTable">
            <tr>
            	<td class="td3" style="width: 46%;">
            	<div class="name1 wallet">我的零钱总额：<span><span>${amountSum}</span>元</span></div>
            	
            	<div class="name1">
	            	<span class="child">可用金额：<span>${amount}元</span></span>
	            	<span class="child">提现中金额:<span>${amountRollOut}元</span></span>
		           	<!-- <input type="button"  class="inButton btn btn-success" value="充值 " onclick="openRollIn()"> -->
	            	<input type="button" style="width:80px;"  class="inButton btn btn-success" value="提现 " onclick="openRollOut()">
	            	<input type="button"  class="inButton btn btn-success" style="padding-left:10px;padding-right:10px;*+padding-left:0;*+padding-right:0;" value="二维码收款 " onclick="openPayQrcode()">
            	</div>
            	</td>
            	<td class="td3" style="width: 25%;">
            	<div class="name1">我的账户管理</div>
            	<div class="name1">
	            	<!-- <input type="button"  class="inButton btn btnn btn-success" value="银行卡管理 "> -->
	            	<input type="button"  class="inButton btn btnn btn-success" value="设置平台交易密码 " style="padding-left:10px;padding-right:10px;" onclick="window.location='${pageContext.request.contextPath}/admin/userWallet_payPasswordView.action'">
            	</div>
         
            	</td>
            	<td class="td3" style="width:28%;">
            	<div class="name1">进行中的红包</div>
            	<div class="name1">
            		<span class="child spa">${redenv}个</span>
	            	<input type="button"  class="inButton btn btn-success" value="发定额红包 " style="padding-left:10px;padding-right:10px;*+padding:0;*+float:left;" onclick="toRedEnv('1')">
	            	<input type="button"  class="inButton btnn btn btn-success" value="发随机红包 " style="padding-left:10px;padding-right:10px;*+padding:0;*+width:80px;;*+float:left;" onclick="toRedEnv('2')">
	            	<!--<input type="button"  class="inButton btnn btn btn-success" value="发定额加随机红包 ">-->
            	
            	</div>
            	</td>
            </tr>
			</table>
            <div class="panel-heading" style="background: #fff;">
            </div>
            <div class="panel-body">
               		<div class="search_div" id="search1"  style="display: none">
						<div class="form-group">
							<label class="selectlabe1 col-md-1 form-lable lt" style="width:142px!important;*+width:136px !important \0;*+width:88px !important;">充值订单编号：</label>
							<div class="selectdivs col-md-3 lt"  style="padding-left:0px;width: 170px;">
								<input id="ORDERID1" name="ORDERID1" type="text" class="form-control"/>
							</div>
							<label class="selectlabe1 col-md-1 form-lable lt">日期范围：</label>
	                        <div class="col-sm-3 lt">
	                            <div class="input-group" style="width:300px\9;*+width:340px;">
									<input class="form-control col-md-1 lt date" name="datefrom1" id='datefrom1' onclick="WdatePicker()"/>
	                                <div class="input-group-addon lt">to</div>
	                                <input class="form-control col-md-1 lt date" name='dateto1' id='dateto1' onclick="WdatePicker()"/>
	                            </div>
	                        </div>
	                        <!-- <div class="col-md-1 form-action lt form-action1 no_padding" >
							  <button class="btn btn-success form-control query" id="query">查询</button>
							</div>
							<div class="col-md-1 form-action lt no_padding">
							  <button class="btn btn-success form-control" id="resetForm">清空</button>
							</div> -->
						</div>
					</div>
					<div class="search_div" id="search2">
						<div class="form-group">
							<label class="selectlabe1 col-md-1 form-lable lt" style="width:130px !important;*+width:110px !important;">提现订单编号：</label>
							<div class="selectdivs col-md-3 lt"  style="padding-left:0px;width: 170px;">
								<input id="ORDERID2" name="ORDERID2" type="text" class="form-control"/>
							</div>
							<label class="selectlabe1 col-md-1 form-lable lt">日期范围：</label>
	                        <div class="col-sm-3 lt">
	                            <div class="input-group" style="width:400px\9;*+width:400px;">
	                                <input class="form-control col-md-1 lt date" name="datefrom2" id='datefrom2' onclick="WdatePicker()"/>
	
	                                <div class="input-group-addon lt">to</div>
	                                <input class="form-control col-md-1 lt date" name='dateto2' id='dateto2' onclick="WdatePicker()"/>
	                            </div>
	                        </div>
	                        <div class="col-md-1 form-action lt no_padding" >
							<button class="btn btn-success form-control query" id="query">查询</button>
							</div>
							<div class="col-md-1 form-action lt no_padding">
							<button class="btn btn-success form-control" id="resetForm">清空</button>
							</div>
						</div>
					</div>
					<div class="search_div" id="search3" style="display: none;">
						<div class="form-group">
							<label class="selectlabe1 col-md-1 form-lable lt" style="width: 140px!important">订单编号：</label>
							<div class="selectdivs col-md-3 lt"  style="padding-left:0px;width: 170px;">
								<input id="ORDERID3" name="ORDERID3" type="text" class="form-control"/>
							</div>
							<label class="selectlabe1 col-md-1 form-lable lt">日期范围：</label>
	                        <div class="col-sm-3 lt">
	                            <div class="input-group" style="width:400px\9;*+width:400px;">
									<input class="form-control col-md-1 lt date" name="datefrom3" id='datefrom3' onclick="WdatePicker()"/>
	                                <div class="input-group-addon lt">to</div>
	                                <input class="form-control col-md-1 lt date" name='dateto3' id='dateto3' onclick="WdatePicker()"/>
	                            </div>
	                        </div>
						</div>
						<!-- <div class="form-group">
							<label class="selectlabe1 col-md-1 form-lable lt">收款帐号：</label>
							<div class=" col-md-3 lt" >
								<div class="input-group" style="">
								<input id="ORDERID" name="ORDERID" type="text" class="form-control"/>
								</div>
							</div>
							<label class="selectlabe1 col-md-1 form-lable lt">付款帐号：</label>
							<div class="selectdivs col-md-3 lt"  style="padding-left:0px;width: 170px;">
								<input id="ORDERID" name="ORDERID" type="text" class="form-control"/>
							</div> -->
							
	                       <div class="col-md-1 form-action lt no_padding" >
							<button class="btn btn-success form-control query" id="query">查询</button>
							</div>
							<div class="col-md-1 form-action lt no_padding">
							<button class="btn btn-success form-control" id="resetForm">清空</button>
							</div>
						</div>
					</div>
            </div>
        </div>

	    <div class="jqGrid_wrapper">
	        <div id="jqGrid_operation" class="jg-grid">
	            <div class="jqGrid_operation" id="action">
	            </div>
	            
	            <!-- <a class="act" href="javascript:;" onclick="">充值记录</a>| -->
				<a style="" href="javascript:;" onclick="javascript:post(2)">提现记录</a>|
				<a style="" href="javascript:;" onclick="javascript:post(3)">二维码收款</a>
	        </div>
	        <div id="jqgrid_table">
		        <table id="jqGrid"></table>
		        <div id="jqGrid_paper"></div>
	        </div>
	    </div>
    </div>
</div>
<script>
//#jqGrid_operation点击时字体变颜色
 
	$("#jqGrid_operation a").click(function(){
		$(this).addClass("act").siblings().removeClass("act");
	})

var vtype='${vtype}';
    $(document).ready(
            function () {
                var flag = true;
            	$.ajax({
                    type: "POST",
                    async: false,
                    url: '/admin/auth_buttons.action',
                    data: "url=" + window.location.pathname,
                    success: function (data) {
                        data = eval("(" + data + ")");
                        for (var i in data) {
                            var action = data[i].mName;
                            switch (action) {
                                
                            }
                        }
                    }
                });

                $.jgrid.defaults.styleUI = "Bootstrap";
              
                
                if(vtype=='rollIn'){
                	openRollIn();	
                }
                if(vtype=='rollOut'){
                	openRollOut();	
                }
                
                if(vtype=='1'||vtype=='2'){
                	post(vtype);	
                }else{
                	post(2);
                }
                
                
                
                <!--查询-->
                jQuery(".query").click(query);
                jQuery("#resetForm").click(resetForm);
                

            });
   
    <!--刷新jqGrid表格数据-->
    function refreshGrid() {
        $("#jqGrid").trigger("reloadGrid");
    }
    function query() {
    	var vv='2';
    	if(vtype=='3'){
    		vv=vtype;
    	}
    	
        var $ORDERID = $("#ORDERID"+vv).val();
        var $datefrom = $("#datefrom"+vv).val();
        var $dateto = $("#dateto"+vv).val();
        $("#jqGrid").jqGrid('setGridParam', {
            url: "${pageContext.request.contextPath}/admin/userWallet_list.action",
            postData: {
                'orderid': $ORDERID,
                'datefrom': $datefrom,
                'dateto': $dateto,
                'type': vv,
            }, //发送数据
            page: 1
        }).trigger("reloadGrid"); //重新载入
        return false; 
    }
    function resetForm() {
        location.reload();
        return false;
    }
    function post(type) {
    	$(".search_div").hide();
    	$("#search"+type).show();
    	//$("#jqGrid").clearGridData();
    	//$("#jqGrid").trigger('gridUnload');
    	//$('#jqGrid').GridUnload();
    	$("#jqgrid_table").html("<table id='jqGrid'></table><div id='jqGrid_paper'></div>");//尝试使用jqGrid的重置方法没有成功，改用把元素重置 by wangk
    	if(type=='1'){
    		$("#jqGrid").jqGrid(
               {
                   url: "${pageContext.request.contextPath}/admin/userWallet_list.action?type="+type,
                   mtype: 'POST',
                   datatype: "json",
                   height: 350,
                   autowidth: true,
                   shrinkToFit: true,
                   rowNum: 10,
                   rowList: [10, 20, 30],
                   colNames: ['序号', '充值账号', '付款账户', '充值订单号', '充值金额','状态', '充值时间','到账时间'],
                   colModel: [{
                       name: "SID",
                       index: "SID",
                       key: true,
                       hidden: true
                   }, {
                       name: 'CITYCODE',
                       index: 'CITYCODE'
                   }, {
                       name: 'AGTNAME',
                       index: 'AGTNAME'
                   }, {
                       name: 'COMMUNITYNAME',
                       index: 'COMMUNITYNAME'
                   }, {
                       name: 'AUNAME',
                       index: 'AUNAME'
                   }, {
                       name: 'NICKNAME',
                       index: 'NICKNAME'
                   }, {
                       name: 'TEL',
                       index: 'TEL'
                   }, {
                       name: 'TEL',
                       index: 'TEL'
                   }],
                   sortname: 'sid',
                   sortorder:'desc',
                   rownumbers: true,
                   jsonReader: {
                       root: 'rows',
                       page: "page",
                       total: 'total',
                       records: "records",
                       repeatitems: false
                   },
                   pager: "#jqGrid_paper",
                   viewrecords: true,
                   multiselect: false,
                   hidegrid: false,
                   loadComplete: function(){
               		var re_records = Number($("#jqGrid").getGridParam('records'));
               		var page = Number($("#jqGrid").getGridParam('page'));
               		var rows=Number($("#jqGrid").getGridParam('rowNum'));
               		var num = re_records-(page-1)*rows;
               		if(num < rows)
               		{
               			for(var i=num;i<rows;i++){
               				$("#jqGrid").jqGrid("addRowData",(i+1),
                       				{ "SID":"", "CITYCODE":"", "AGTNAME":"", "COMMUNITYNAME":"", "CBUNAME":"","AUNAME":"","TEL":"","BANNERNUM":"-1","DD":"-1","DDJE":"-1","UALNUM":"-1"}
               				,"");
               			}
               			$(".ui-paging-info").html(re_records-num+1 +" - "+re_records+"　共 "+re_records+" 条");
               		}

               	}
            });
    	}else if(type=='2'){
    		$("#jqGrid").jqGrid(
 	               {
 	                   url: "${pageContext.request.contextPath}/admin/userWallet_list.action?type="+type,
 	                   mtype: 'POST',
 	                   datatype: "json",
 	                   height: 350,
 	                   autowidth: true,
 	                   shrinkToFit: true,
 	                   rowNum: 10,
 	                   rowList: [10, 20, 30],
 	                   colNames: ['序号', '申请账号', '提现至账户', '提现单号', '提现金额','状态', '申请时间','到账时间'],
 	                   colModel: [{
 	                       name: "SID",
 	                       index: "SID",
 	                       key: true,
 	                       hidden: true
 	                   }, {
 	                       name: 'CNAME',
 	                       index: 'CNAME'
 	                   }, {
 	                       name: 'PAYEE_ACCOUNT',
 	                       index: 'PAYEE_ACCOUNT'
 	                   }, {
 	                       name: 'PAY_NO',
 	                       index: 'PAY_NO'
 	                   },{
	                          name: "AMOUNT",
	                          index: "AMOUNT",
	                          width: 80,
	                          formatter: function (cellvalue, options, rawObject) {
	                        	  if(cellvalue!= ""&&typeof(cellvalue)!="undefined"){
								   	return "<font style='color: #ff0000;'>￥"+cellvalue+"</font>";
								   	
	                        	  }
	                        	  return "";
		                      }
	                          
	                   },{
                          name: "STATUS",
                          index: "STATUS",
                          width: 80,
                          formatter: function (cellvalue, options, rawObject) {
                        	  if(cellvalue!= ""&&typeof(cellvalue)!="undefined"){
		                          if(cellvalue=='0'){
		                        	  return "<a style='color: #ff0000;' onclick='showRolllOutResult("+rawObject.SID+")'>受理中</a>";  
		                          }else if(cellvalue=='1'){
		                        	  return "<a style='color: #83d089;' onclick='showRolllOutResult("+rawObject.SID+")'>已到账</a>";
		                          }else if(cellvalue=='2'){
		                        	  return "<a style='color: #666;' onclick='showRolllOutResult("+rawObject.SID+")'>提现失败</a>";
		                          }
                        	  }
                        	  return "";
	                      }
	                   },{
 	                       name: 'APPLY_DATE',
 	                       index: 'APPLY_DATE'
 	                   }, {
 	                       name: 'TO_DATE',
 	                       index: 'TO_DATE'
 	                   }],
 	                   sortname: 'sid',
 	                   sortorder:'desc',
 	                   rownumbers: true,
 	                   jsonReader: {
 	                       root: 'rows',
 	                       page: "page",
 	                       total: 'total',
 	                       records: "records",
 	                       repeatitems: false
 	                   },
 	                   pager: "#jqGrid_paper",
 	                   viewrecords: true,
 	                   multiselect: false,
 	                   hidegrid: false,
 	                   loadComplete: function(){
 	               		var re_records = Number($("#jqGrid").getGridParam('records'));
 	               		var page = Number($("#jqGrid").getGridParam('page'));
 	               		var rows=Number($("#jqGrid").getGridParam('rowNum'));
 	               		var num = re_records-(page-1)*rows;
 	               		if(num < rows)
 	               		{
 	               			for(var i=num;i<rows;i++){
 	               				$("#jqGrid").jqGrid("addRowData",(i+1),
 	                       				{ "SID":"", "CITYCODE":"", "AGTNAME":"", "COMMUNITYNAME":"", "CBUNAME":"","AUNAME":"","TEL":"","BANNERNUM":"-1","DD":"-1","DDJE":"-1","UALNUM":"-1"}
 	               				,"");
 	               			}
 	               			$(".ui-paging-info").html(re_records-num+1 +" - "+re_records+"　共 "+re_records+" 条");
 	               		}

 	               	}
 	            });
    	}else if(type=='3'){
    		$("#jqGrid").jqGrid(
  	               {
  	                   url: "${pageContext.request.contextPath}/admin/userWallet_list.action?type="+type,
  	                   mtype: 'POST',
  	                   datatype: "json",
  	                   height: 350,
  	                   autowidth: true,
  	                   shrinkToFit: true,
  	                   rowNum: 10,
  	                   rowList: [10, 20, 30],
  	                   colNames: ['序号', '收款账号', '付款账户', '订单编号', '付款金额','状态', '付款时间','到账时间'],
  	                   colModel: [{
 	                       name: "SID",
 	                       index: "SID",
 	                       key: true,
 	                       hidden: true
 	                   }, {
 	                       name: 'CNAME',
 	                       index: 'CNAME'
 	                   }, {
 	                       name: 'PAYEE_ACCOUNT',
 	                       index: 'PAYEE_ACCOUNT'
 	                   }, {
 	                       name: 'PAY_NO',
 	                       index: 'PAY_NO'
 	                   },{
	                          name: "AMOUNT",
	                          index: "AMOUNT",
	                          width: 80,
	                          formatter: function (cellvalue, options, rawObject) {
	                        	  if(cellvalue!= ""&&typeof(cellvalue)!="undefined"){
								   	return "<font style='color: #ff0000;'>￥"+cellvalue+"</font>";
								   	
	                        	  }
	                        	  return "";
		                      }
	                          
	                   },{
                          name: "STATUS",
                          index: "STATUS",
                          width: 80,
                          formatter: function (cellvalue, options, rawObject) {
                        	  if(cellvalue!= ""&&typeof(cellvalue)!="undefined"){
		                          if(cellvalue=='0'){
		                        	  return "<a style='color: #ff0000;' onclick='showRolllOutResult("+rawObject.SID+")'>受理中</a>";  
		                          }else if(cellvalue=='1'){
		                        	  return "<a style='color: #83d089;' onclick='showRolllOutResult("+rawObject.SID+")'>已到账</a>";
		                          }else if(cellvalue=='2'){
		                        	  return "<a style='color: #666;' onclick='showRolllOutResult("+rawObject.SID+")'>提现失败</a>";
		                          }
                        	  }
                        	  return "";
	                      }
	                   },{
 	                       name: 'APPLY_DATE',
 	                       index: 'APPLY_DATE'
 	                   }, {
 	                       name: 'TO_DATE',
 	                       index: 'TO_DATE'
 	                   }],
  	                   sortname: 'sid',
  	                   sortorder:'desc',
  	                   rownumbers: true,
  	                   jsonReader: {
  	                       root: 'rows',
  	                       page: "page",
  	                       total: 'total',
  	                       records: "records",
  	                       repeatitems: false
  	                   },
  	                   pager: "#jqGrid_paper",
  	                   viewrecords: true,
  	                   multiselect: false,
  	                   hidegrid: false,
  	                   loadComplete: function(){
  	               		var re_records = Number($("#jqGrid").getGridParam('records'));
  	               		var page = Number($("#jqGrid").getGridParam('page'));
  	               		var rows=Number($("#jqGrid").getGridParam('rowNum'));
  	               		var num = re_records-(page-1)*rows;
  	               		if(num < rows)
  	               		{
  	               			for(var i=num;i<rows;i++){
  	               				$("#jqGrid").jqGrid("addRowData",(i+1),
  	                       				{ "SID":"", "CITYCODE":"", "AGTNAME":"", "COMMUNITYNAME":"", "CBUNAME":"","AUNAME":"","TEL":"","BANNERNUM":"-1","DD":"-1","DDJE":"-1","UALNUM":"-1"}
  	               				,"");
  	               			}
  	               			$(".ui-paging-info").html(re_records-num+1 +" - "+re_records+"　共 "+re_records+" 条");
  	               		}

  	               	}
  	            });
    	}else{}
    	
    	
    	
    	
    };
    
    
    
    function toRedEnv(vtype){
    	window.location="${pageContext.request.contextPath}/admin/redPacket_redEnvlistView.action?vtype="+vtype+"&random="+uuid();
    	//$("#searchForm").attr("action","${pageContext.request.contextPath}/admin/redPacket_redEnvlistView.action");
    	//$("#vtype").val(vtype)
   		//$("#searchForm").submit();
    	
    	
    }

	function uuid() {
		var s = [];
		var hexDigits = "0123456789abcdef";
		for (var i = 0; i < 36; i++) {
			s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
		}
		s[14] = "4"; // bits 12-15 of the time_hi_and_version field to 0010
		s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01
		s[8] = s[13] = s[18] = s[23] = "-";

		var uuid = s.join("");
		return uuid;
	}

	window.onload = function() {

		function BrowserType() {
			//获取浏览器的userAgent代理号；
			var userAgent = navigator.userAgent;

			//判断是否是Opera浏览器
			var isOpera = userAgent.indexOf("Opera") > -1;
			//判断是否是IE浏览器
			var isIE = userAgent.indexOf("compatible") > -1
					&& userAgent.indexOf("MSIE") > -1 && !isOpera;
			//判断是否是IE7浏览器
			if (isIE) {
				var relIE = new RegExp("MSIE(\\d+\\.\\d+);");

				relIE.test(userAgent);
				var arr = userAgent.split(";")
				var flEVersion = arr[1].indexOf("7");
				
				if (flEVersion > -1) {
					var $td = $(".jqgrid-rownum")[0];
					$td.style.width = "0";
					$tr = $("thead tr th");
					$td = $("tbody tr td");
					var len = $tr.length;
					for (var i = 0; i < len; i++) {
						$tr[i].style.width = 10 + "px";
						$td[i].style.width = 10 + "px";
					};
					
				}
			}
		}
		;
		BrowserType();
	};

	function openRollIn() {
		layer.open({
					type : 2,
					title : [ '填写充值金额', 'font-weight:bold' ],
					//title:false,
					shadeClose : true, //点击遮罩关闭层
					area : [ '800px', '530px' ],
					scrollbar : false,
					content : '${pageContext.request.contextPath}/admin/userWallet_rollInView.action',
					yes : function(index, layero) {
						var options = {
							success : function(data) {
								data = JSON.parse(data);
								if (data.code == 1) {
									layer.alert(data.msg, function() {
										layer.closeAll();
										refreshGrid();
									});
								} else {
									layer.alert(data.msg);
								}
							}
						};
						$("#layui-layer-iframe" + index).contents().find(
								"#form").ajaxForm(options);
						$("#layui-layer-iframe" + index).contents().find(
								"#form").submit();
					},
					cancel : function(index, layero) {
						layer.close(index);
					}
				});
	}

	function openRollOut() {
		var index=layer.open({
					type : 2,
					title : [ '提现验证', 'font-weight:bold' ],
					//title:false,
					shadeClose : true, //点击遮罩关闭层
					area : '800px',
					scrollbar : false,
					content:'${pageContext.request.contextPath}/admin/userWallet_rollOutView.action',
					success: function(layero, index){
                     var width = layer.getChildFrame('body', index).prop('scrollHeight');
					 /*
                     layer.style(index, {
						 height:450
                     });
                     layer.iframeAuto(index);
					 */
                  },
					yes : function(index, layero) {
						var options = {
							success : function(data) {
								data = JSON.parse(data);
								if (data.code == 1) {
									layer.alert(data.msg, function() {
										layer.closeAll();
										refreshGrid();
									});
								} else {
									layer.alert(data.msg);
								}
							}
						};
						$("#layui-layer-iframe" + index).contents().find(
								"#form").ajaxForm(options);
						$("#layui-layer-iframe" + index).contents().find(
								"#form").submit();
					},
					cancel : function(index, layero) {
						layer.close(index);
					}
				});
	}
	
	function openPayQrcode(){
		layer.open({
			type : 2,
			title : [ '二维码收款', 'font-weight:bold' ],
			//title:false,
			shadeClose : true, //点击遮罩关闭层
			area : [ '900px', '500px' ],
			scrollbar : false,
			content : '${pageContext.request.contextPath}/admin/payQrcode_addView.action',
			yes : function(index, layero) {
				var options = {
					success : function(data) {
						data = JSON.parse(data);
						if (data.code == 1) {
							layer.alert(data.msg, function() {
								layer.closeAll();
								refreshGrid();
							});
						} else {
							layer.alert(data.msg);
						}
					}
				};
				$("#layui-layer-iframe" + index).contents().find(
						"#form").ajaxForm(options);
				$("#layui-layer-iframe" + index).contents().find(
						"#form").submit();
			},
			cancel : function(index, layero) {
				layer.close(index);
			}
		});
	}
	
	

	function showRolllOutResult(sid){
		layer.open({
			type : 2,
			title : [ '提现状态', 'font-weight:bold' ],
			//title:false,
			shadeClose : true, //点击遮罩关闭层
			area : [ '600px', '330px' ],
			scrollbar : false,
			content : '${pageContext.request.contextPath}/admin/userWallet_showRollOutResult.action?sid='+sid,
			yes : function(index, layero) {
				var options = {
					success : function(data) {
						data = JSON.parse(data);
						if (data.code == 1) {
							layer.alert(data.msg, function() {
								layer.closeAll();
								refreshGrid();
							});
						} else {
							layer.alert(data.msg);
						}
					}
				};
				$("#layui-layer-iframe" + index).contents().find(
						"#form").ajaxForm(options);
				$("#layui-layer-iframe" + index).contents().find(
						"#form").submit();
			},
			cancel : function(index, layero) {
				layer.close(index);
			}
		});
	}
	
	function openChoiceWay(amount) {
		window.location = "${pageContext.request.contextPath}/admin/userWallet_rollInChoiceWay.action?amount="
				+ amount;

	}
	
</script>
</body>
</html>
